cd /Users/xiaosongw/Dropbox/Research/InformedSources/ReplicationRemove2


* ---------------- Table 1: Station Counts and Shares -------------------------*


use ./Data/is_mel_p_2005_2019, clear

keep if t>=td(01jan2015) & t<=td(31dec2015)
keep if ~missing(p)

egen tag = tag(bid id)

contract bid if tag == 1
rename _freq station_count
egen total_stations = total(station_count)
gen share = station_count / total_stations
gen share_percent = "(" + string(round(share * 100, 1)) + "%" + ")"
decode bid, gen(brand)

set obs 7 
replace brand = "Total" in 7
replace share_percent = "(100%)" in 7
replace station_count = 659 in 7

keep brand station_count share_percent
tostring station_count, gen(stations)
gen Stations = stations + " " + share_percent

rename brand Retailer
keep Retailer Stations

save ./Output/tab1.dta, replace
